Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Fix tabs component lazy rendering#47642

Merged
vovakulikov merged 1 commit intomainfrom
vk/fix-lazy-tab-rendering
Feb 15, 2023
Merged

Fix tabs component lazy rendering#47642
vovakulikov merged 1 commit intomainfrom
vk/fix-lazy-tab-rendering

Conversation

@vovakulikov
Copy link
Contributor

@vovakulikov vovakulikov commented Feb 14, 2023

Preparation for https://github.com/sourcegraph/sourcegraph/pull/47572

Prior to this PR, even if we specified the Tab component with lazy true and behaviour memoise, we rendered only the active tab, and there was a jump between tab switching since we were doing show logic in the use effect hook. In this PR we

  • fix memorize behaviour (render opened at least once tab always and do not trigger their life hooks - mount/unmount)
  • fix the flash problem by using the layout effect instead

Test plan

  • Check tab storybook with lazy true and behaviour memoise; tabs should work as expected

App preview:

Check out the client app preview documentation to learn more.

@sourcegraph-bot
Copy link
Contributor

Codenotify: Notifying subscribers in OWNERS files for diff eeb4981...b19f463.

Notify File(s)
@sourcegraph/code-exploration-devs client/wildcard/src/components/Tabs/useShouldPanelRender.ts

@sg-e2e-regression-test-bob

Bundle size report 📦

Initial size Total size Async size Modules
-0.00% (-0.05 kb) -0.00% (-0.10 kb) -0.00% (-0.05 kb) 0.00% (0)

Look at the Statoscope report for a full comparison between the commits b19f463 and eeb4981 or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

@vovakulikov vovakulikov merged commit 17c4e89 into main Feb 15, 2023
@vovakulikov vovakulikov deleted the vk/fix-lazy-tab-rendering branch February 15, 2023 15:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants